/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package MyThread;

import com.ideal.log.Log;
import java.util.concurrent.locks.ReadWriteLock;

/**
 *
 * @author Huyu
 */
public class BCMCWritehread extends Thread {

    private final ReadWriteLock m_lock;

    public BCMCWritehread(ReadWriteLock lock) {
        m_lock = lock;
    }

    @Override
    public void run() {
        try {
            while (true) {
                m_lock.writeLock().lock();
                Log.logger.info("BCMCWriteThread Write");
                Thread.sleep(10000);
                m_lock.writeLock().unlock();
                 Thread.sleep(4000);
            }

        } catch (InterruptedException ex) {

        }
    }

}
